// 编写好规则
export const infoRules = {
  name: [
    { required: true, message: '请输入姓名' },
  ],
  phone: [
    { required: true, message: '请输入联系方式' },
    {
      validator: function(rule, value, callback) {
        if (/^1[3456789]\d{9}$/.test(value) == false) {
          callback(new Error('请输入正确的手机号'))
        } else {
          callback()
        }
      },
      trigger: 'blur'
    }
  ],
  email: [{ required: true, type: 'email', message: '请输入正确的邮箱地址', trigger: 'change' }],
  gender: [
    { required: true, message: '请输入性别' },
  ]
}
